$primary-color: #3cc393;
$primary-active-color: #f0fef8;
$primary-background-color: #ebfff6;

// 关于 图标 CSS 的设置
[class^='icon-'] {
  font-family: 'iconfont' !important;
  /* 以下内容参照第三方图标库本身的规则 */
  font-size: 18px !important;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.avue-input-icon__item i,
.avue-crud__icon--small {
  font-family: 'iconfont' !important;
  /* 以下内容参照第三方图标库本身的规则 */
  font-size: 24px !important;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

// 处理avue下拉图标问题
.icon-arrow-down {
  &:before {
    content: '' !important;
  }
}

.icon-circle-close {
  &:before {
    content: '' !important;
  }
}

.form-designer {
  height: 100%;
  background: #fff;
  outline: 1px solid #e4e7ed;

  ::-webkit-scrollbar {
    width: 10px !important;
    height: 0px !important;
  }

  ::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0) !important;
    border-radius: 10px !important;
    background-color: rgba(0, 0, 0, 0) !important;
  }

  ::-webkit-scrollbar-thumb {
    border-radius: 10px !important;
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0) !important;
    background-color: #fff !important;
  }

  .fields-container {
    width: 100%;
    height: 100%;
    overflow: hidden;

    .search {
      height: 40px;
      line-height: 40px;
      margin: 8px;
    }

    .fields-list {
      // padding: 10px 0;
      width: 100%;
      height: calc(100% - 48px);
      overflow: auto;
      // min-height: 800px;
  
      .field-title {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 8px 12px;
        font-size: 20px;
        min-height: 50px;
        // line-height: 50px;
        border-bottom: 2px solid #e4e7ed;
        margin-bottom: 10px !important;
      }
  
      ul {
        position: relative;
        overflow: hidden;
        padding: 0 10px 10px;
        margin: 0;
      }
  
      .field-label {
        font-size: 14px;
        display: block;
        width: 48%;
        height: 40px;
        line-height: 35px;
        position: relative;
        float: left;
        left: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin: 1%;
        color: #333;
        border: 1px solid #f4f6fc;
        background: #f0f0f0;
        border-radius: 5px;
        &:hover {
          color: $primary-color;
          border: 1px dashed $primary-color;
        }
  
        & > a {
          display: block;
          cursor: move;
          // background: #f4f6fc;
          // border: 1px solid #f4f6fc;
          color: #333;
  
          .icon {
            margin-right: 6px;
            margin-left: 8px;
            font-size: 14px;
            display: inline-block;
            vertical-align: middle;
          }
  
          span {
            display: inline-block;
            vertical-align: middle;
          }
        }
      }
  
      .field-label-disabled {
        font-size: 12px;
        display: block;
        width: 48%;
        line-height: 26px;
        position: relative;
        float: left;
        left: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin: 1%;
        color: #333;
        border: 1px solid #f4f6fc;
  
        &:hover {
          color: gray;
          border: 1px dashed gray;
        }
  
        & > a {
          display: block;
          cursor: not-allowed;
          background: #f4f6fc;
          border: 1px solid #f4f6fc;
  
          .icon {
            margin-right: 6px;
            margin-left: 8px;
            font-size: 14px;
            display: inline-block;
            vertical-align: middle;
          }
  
          span {
            display: inline-block;
            vertical-align: middle;
          }
        }
      }
    }
  }

  .widget-container {
    flex: 1;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;

    .widget-container-header {
      height: 50px !important;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: solid 2px #e4e7ed;
      // .containBox{
      //   height: calc(100vh - 240px);
      //   overflow: auto;
      // }
      .btnStyle {
        color: #3cc393;
      }
    }

    .el-main {
      padding: 0;
      position: relative;
    }
  }

  .widget-form-container {
    height: 100%;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    .el-form {
      height: 100%;
      .el-row {
        height: 100%;
      }
    }

    .widget-form-list {
      height: 100%;
      // min-height: calc(100% - 45px);
      min-height: 150px;
      padding-bottom: 50px;
      overflow: auto;
      display: flex;
      flex-wrap: wrap;
      align-content: flex-start;
      // overflow-y: scroll;

      .widget-form-item {
        min-height: 30px;
        padding: 5px 10px 18px;
        margin: 0;
        position: relative;
        border-left: 5px solid transparent;

        &:after {
          position: absolute;
          left: 0;
          right: 0;
          bottom: 0;
          top: 0;
          display: block;
          z-index: 1001;
        }

        &:hover {
          background: $primary-background-color;
          cursor: move;
        }

        &.active {
          border-left: 3px solid $primary-color;
          background: $primary-active-color;
        }

        .widget-action-delete {
          position: absolute;
          right: 10px;
          bottom: -20px;
          z-index: 1002;
        }

        .widget-action-clone {
          position: absolute;
          right: 50px;
          bottom: -20px;
          z-index: 1002;
        }
      }

      .parentRef {
        .el-form-item__label {
          color: #dcdfe6;
        }
      }

      .widget-form-grid {
        width: 100%;
        position: relative;
        padding: 2px;
        float: left;

        &__head {
          margin: 10px;
        }

        &__body {
          display: flex;
          min-height: 150px;
          height: 100%;
          outline: 1px dashed #ccc;
          outline-offset: -1px;
          overflow: hidden;
          padding-bottom: 15px;
        }

        &__item {
          min-height: 150px;
          outline: 1px dashed #ccc;
          outline-offset: -1px;
          background-color: #fff;
        }

        > .widget-action-delete {
          position: absolute;
          right: 10px;
          bottom: -12px;
          z-index: 1001;
        }

        > .widget-action-clone {
          position: absolute;
          right: 50px;
          bottom: -12px;
          z-index: 1001;
        }

        .widget-form-list {
          height: auto;
          padding: 4px;
          min-height: 80px;

          .widget-form-item {
            &.active {
              background-color: #fff;
              border-left: 0px;
              outline: 1px solid $primary-color;
              outline-offset: -1px;
            }

            &:hover {
              background-color: #fff;
              outline: 1px solid $primary-color;
              outline-offset: -1px;
            }
          }
        }

        &.active {
          border-left: 3px solid $primary-color;
          background: $primary-active-color;
        }

        &:hover {
          background: $primary-background-color;
          cursor: move;
        }
      }

      .widget-form-tabs {
        width: 100%;
        position: relative;
        padding: 2px;
        float: left;

        &__head {
          margin: 10px;
        }

        &__body {
          min-height: 150px;
          height: 100%;
          outline-offset: -1px;
          overflow: hidden;
          padding-bottom: 15px;
        }

        &__item {
          min-height: 150px;
          background-color: #fff;
        }

        > .widget-action-delete {
          position: absolute;
          right: 10px;
          bottom: -12px;
          z-index: 1001;
        }

        > .widget-action-clone {
          position: absolute;
          right: 50px;
          bottom: -12px;
          z-index: 1001;
        }

        .widget-form-list {
          height: auto;
          padding: 4px;
          min-height: 80px;

          .widget-form-item {
            &.active {
              background-color: #fff;
              border-left: 0px;
              outline: 1px solid $primary-color;
              outline-offset: -1px;
            }

            &:hover {
              background-color: #fff;
              outline: 1px solid $primary-color;
              outline-offset: -1px;
            }
          }
        }

        &.active {
          border-left: 3px solid $primary-color;
          background: $primary-active-color;
        }

        &:hover {
          background: $primary-background-color;
          cursor: move;
        }
      }

      .widget-form-table {
        position: relative;
        padding: 2px;
        float: left;
        width: 100%;

        &__content {
          display: flex;
          padding: 10px 5px;
          width: 100%;
          height: 100%;
          overflow-y: hidden;
          outline: 1px dashed #ccc;
          outline-offset: -1px;
          min-height: 103px;

          &::-webkit-scrollbar {
            width: 6px !important;
            height: 6px !important;
          }

          &::-webkit-scrollbar-thumb {
            background-color: #e5e7eb !important;
          }

          .ghost {
            background: white;
            border-left: 2px solid $primary-color;
            box-sizing: border-box;
            font-size: 0;
            content: '';
            overflow: hidden;
            padding: 0 !important;
            position: relative;
            outline: none 0;
            height: 100%;
            min-height: 50px;
            width: 100%;
            // width: 0 !important;
            min-width: 0 !important;
            margin: 1px 2px 0 2px;
          }
        }

        &__item {
          position: relative;
          min-width: 33.3%;
          width: 33.3%;
          padding: 1px;
          // height: 100%;

          .anvil-code-custom-button {
            display: inline-block !important;
          }

          &.required {
            .el-table__header .cell::before {
              content: '*';
              color: #f56c6c;
              margin-right: 4px;
            }
          }

          &.active {
            outline: 1px solid $primary-color;
            outline-offset: -1px;
          }

          &:hover {
            outline: 1px solid $primary-color;
            outline-offset: -1px;
            cursor: move;
          }

          &:after {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            top: 0;
            display: block;
            content: '';
            z-index: 1001;
          }

          .widget-table-action-delete {
            position: absolute;
            right: 10px;
            bottom: 0;
            z-index: 1002;
          }

          .widget-table-action-clone {
            position: absolute;
            right: 50px;
            bottom: 0;
            z-index: 1002;

            i {
              font-size: 10px;
            }
          }

          .el-button--small.is-circle {
            padding: 5px;
          }
        }

        &.active {
          border-left: 3px solid $primary-color;
          background: $primary-active-color;
        }

        &:hover {
          background: $primary-background-color;
          cursor: move;
        }

        .widget-action-delete {
          position: absolute;
          right: 10px;
          bottom: -12px;
          z-index: 1001;
        }

        .widget-action-clear {
          position: absolute;
          right: 50px;
          bottom: -12px;
          z-index: 1001;
        }

        .widget-action-clone {
          position: absolute;
          right: 90px;
          bottom: -12px;
          z-index: 1001;
        }

        .widget-action-generate {
          position: absolute;
          right: 130px;
          bottom: -12px;
          z-index: 1001;
        }
      }

      .widget-form-group {
        position: relative;
        width: 100%;
        // float: left;
        padding: 2px;

        &__head {
          margin: 10px;
        }

        &__body {
          // display: flex;
          // flex-wrap: wrap;
          min-height: 150px;
          height: 100%;
          outline: 1px dashed #ccc;
          outline-offset: -1px;
          overflow: hidden;
          padding-bottom: 15px;

          .widget-form-list {
            height: auto;
            padding: 4px;
            min-height: 80px;

            .widget-form-item {
              padding: 10px;
              margin: 3px;
              position: relative;
              border-left: 5px solid transparent;
              background: white;
    
              &.required {
                .el-form-item__label::before {
                  content: '*';
                  color: #f56c6c;
                  margin-right: 4px;
                }
              }
    
              &.active {
                outline: 1px solid $primary-color;
                outline-offset: -1px;
              }
    
              &:hover {
                outline: 1px solid $primary-color;
                outline-offset: -1px;
                cursor: move;
              }
    
              &:after {
                position: absolute;
                left: 0;
                right: 0;
                bottom: 0;
                top: 0;
                display: block;
                content: '';
                z-index: 1001;
              }
    
              .widget-action-delete {
                position: absolute;
                right: 10px;
                bottom: -10px;
                z-index: 1002;
              }
    
              .widget-action-clone {
                position: absolute;
                right: 50px;
                bottom: -10px;
                z-index: 1002;
              }
            }
          }
        }

        &.active {
          border-left: 3px solid $primary-color;
          background: $primary-active-color;
        }

        &:hover {
          background: $primary-background-color;
          cursor: move;
        }

        .widget-action-delete {
          position: absolute;
          right: 10px;
          bottom: -12px;
          z-index: 1001;
        }

        .widget-action-clear {
          position: absolute;
          right: 50px;
          bottom: -12px;
          z-index: 1001;
        }

        .widget-action-clone {
          position: absolute;
          right: 90px;
          bottom: -12px;
          z-index: 1001;
        }
      }

      .iconfont {
        font-size: 13px;
      }

      .el-button--small.is-circle {
        padding: 7px;
      }
    }

    .ghost {
      background: #fff;
      min-height: 50px;
      max-height: 500px;
      border: 2px dashed $primary-color;
      box-sizing: border-box;
      font-size: 0;
      content: '';
      overflow: hidden;
      padding: 0 !important;
      position: relative;
      outline: none 0;
      // height: 0 !important;
      width: 50%;
      margin: 2px 0;
    }

    .ghostLine {
      background: #fff;
      min-height: 50px;
      max-height: 500px;
      border: 2px dashed $primary-color;
      box-sizing: border-box;
      font-size: 0;
      content: '';
      overflow: hidden;
      padding: 0 !important;
      position: relative;
      outline: none 0;
      // height: 0 !important;
      width: 100%;
      margin: 2px 0;
    }
  }

  .widget-app {
    width: 360px;
    max-height: 640px;
    margin: 4% auto 0 auto;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    background-color: #e0e0e0;
    box-shadow: 0 8px 40px 0 rgba(17, 31, 44, 0.12);

    .bd-app {
      padding: 10px;
    }

    .row-app {
      border: 1px solid #e0e0e0;
      border-radius: 14px;
      padding: 10px 0;
      background-color: #fff;
    }
  }

  .widget-config-container {
    height: 100%;
    padding-top: 5px;
    .el-tabs__item {
      height: 50px;
    }
    .el-tabs__item.is-active {
      color: #3cc393;
      // height: 50px;
      // margin-bottom: 5px;
    }
    .el-tab-pane {
      margin-top: 10px;
    }
    .el-collapse {
      border: none;
    }
    .el-tabs__active-bar {
      background-color: #3cc393 !important;
    }
    .el-tabs {
      height: 100%;
    }

    .el-tabs__header {
      margin: 0;
      // height: 45px;
      background: white;
      z-index: 1000;
    }

    .el-tabs__content {
      height: calc(100% - 45px);
      overflow-y: scroll;
    }
    .el-switch.is-checked .el-switch__core {
      // border-color: #3cc393 !important;
      // background-color: #3cc393 !important;
    }
    .code-button--primary {
      // border-color: #3cc393;
      // background-color: #3cc393;
    }
    .widget-config {
      .anvil-code-custom-button {
        display: inline-block !important;
      }

      .el-tabs__header {
        position: relative;
        display: block;
        top: 0;
        margin: 0;
      }

      .el-tabs__content {
        margin-top: 0;
      }

      .ghost {
        background: #fff;
        border: 1px dashed $primary-color;
      }

      ul {
        margin: 0;
        padding: 0;

        li {
          display: flex;
          align-items: center;
          width: 100%;

          .ghost {
            list-style: none;
            font-size: 0;
            height: 35px;
          }
        }
      }
    }
    .avue-group__item {
      padding: 0;
    }
  }

  .el-container {
    height: 100%;

    .el-main {
      height: calc(100% - 45px);
    }

    .el-aside {
      background: #fff;
      height: 100%;
      // height: calc(100vh - 240px);
      overflow: auto;
      padding: 0px;
    }
  }

  .danger {
    color: #f56c6c;
  }

  .warning {
    color: #e6a23c;
  }

  .el-input-number.is-controls-right {
    .el-input-number__decrease {
      border-left: none;
    }
    .el-input-number__increase {
      border-left: none;
      border-bottom: none;
    }
  }

  .el-date-editor,
  .el-cascader,
  .el-select,
  .el-input-number {
    width: 100%;
  }

  .editor-fullscreen {
    position: fixed !important;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100% !important;
    z-index: 1003;
    padding: 20px;
    box-sizing: border-box;
    background: #fff;

    i {
      top: 20px !important;
      left: 25px !important;
    }
  }
}

.afd-drawer-foot {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  display: flex;

  button {
    width: 50%;
  }

  & > span {
    display: inline-block;
    width: 50%;
    button {
      width: 100%;
    }
  }
}

.afd-preview-form {
  overflow-y: auto;
  height: 83vh;
}

.el-col .widget-form-item {
  .el-form-item__content > div {
    width: 100%;
    pointer-events: none;

    span {
      pointer-events: none;
    }
  }

  > .el-form-item__label {
    pointer-events: none;
  }
}

.el-form-item__content {
  display: block;
}

.avue-input-icon__list {
  .avue-input-icon__item {
    width: auto;
  }
}